package view.screen;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.List;

import view.base.ListScreen;
import base.ScreenActionListener;
import controller.Controller;


public final class ConnectionScreen extends ListScreen{
	
	public ConnectionScreen(ScreenActionListener controller, String[] connections){
		super(controller, "Connection Type", List.EXCLUSIVE, connections);

		this.addCommand(new Command("Next", Command.OK, 1));

		this.setCommandListener(this);
	}

	public void commandAction(Command c, Displayable d) {
		switch (c.getCommandType()) {
		case Command.OK:
			controller.viewAction(Controller.SELECT_COMMAND, new Integer(this.getSelectedIndex()));
			break;
		default:
			super.commandAction(c, d);
			break;
		}
	}
}
